<!DOCTYPE html>
<html lang="en" class="no-js" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorator="layout">
<head>
<title>促销活动商品管理</title>
</head>
<body>
<div layout:fragment="content">
	<div class="row">
		<div class="col-md-12">
			<div class="btn-group pull-right">
				<a href="index.html" th:href="@{'/promotion/salespromotiongoods/index/'+${salesPromotionId}}" id="sample_editable_1_new" class="btn green">返回<i class="fa fa-arrow-circle-o-left"></i></a>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<div class="form">
				<form role="form" th:action="@{'/promotion/salespromotiongoods/save/'+${salesPromotionId}}" th:object="${spg}" id="spForm" method="post" class="form-horizontal">
					<h4 class="form-section">促销活动商品信息</h4>
					<input type="hidden" th:field="*{id}" />
					<div class="form-body">
						<div class="form-group">
							<label class="control-label col-md-3">商品名称</label>							
							<div class="col-md-4">
								<div th:text="${spg.goods.name}"></div>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-md-3">促销价格</label>							
							<div class="col-md-4">
								<input type="text" class="form-control" placeholder="促销价格" th:field="*{goodsPrice}"/>
							</div>
						</div>


					</div>
					<div class="form-actions fluid">
						<div class="col-md-offset-3 col-md-9">
							<button id="bt_submit" type="submit" class="btn blue">提交</button>
						</div>
					</div>
				</form>		
			</div>
		</div>
	</div>
</div>	
</body>
</html>
<script th:inline="javascript">
    /*<![CDATA[*/
       $(document).ready(function(){
    	   $("#spForm").validate({
               rules:{

            	   goodsPrice:{
                       required:true,
                       number:true,
                       max:99999999.99
                   }

               },
               messages:{

            	   goodsPrice:{
                       required:"请输入商品促销金额",
                       number:"请输入正确的金额"
                   }
                   

               }
           });
       });
       
        /*]]>*/
</script>